
    <div class="content margin_top_foot">
        <div class="searchbar fixed_top bg_mx_green white"></div>
        <div class="swipe">
            <div class='swipe-wrap'></div>
            <ul class="position"></ul>
        </div>
        <div class="margin_b_10 padding_10_15 bg_white flex text_center">

            <div class="flex_1">
                <a href="<{url route='/farmerhouse/site/index'}>">
                <div class="bg_success iconfont icon-productheart block_40 block_center circle font_20"></div>
                <div>全部农家乐</div>
                </a>
            </div>

            <div class="flex_1">
                <a href="<{url route='/farmerhouse/site/index?recommand=1'}>">
                <div class="bg_danger iconfont icon-good block_40 block_center circle font_20"></div>
                <div>推荐</div>
                </a>
            </div>
            <div class="flex_1">
                <a href="<{url route='/farmerhouse/site/raiders'}>">
                    <div class="bg_warning iconfont icon-book block_40 block_center circle font_20"></div>
                    <div>游记</div>
                </a>
            </div>
            <div class="flex_1">
                <a href="tel:<{$tel}>">
                <div class="bg_info iconfont icon-telephone block_40 block_center circle font_20"></div>
                <div>客服</div>
                </a>
            </div>
        </div>
        <div class="margin_b_10 bg_white">
            <div class="font_16 v_center margin_b_10 padding_10_15">
                <span class="bg_mx_green title_mark"></span>
                <span class="padding_l_10">农家乐</span>
            </div>

            <div class="refresh_content">
                <div class="pull_refresh">
                    <div class="farmhouse"></div>
                    <div class="pros"></div>
                </div>
            </div>
            <div class="refresh_load"><div class="refresh_pull_arrow"></div></div>
        </div>
        <div class="sidebar fixed lineheight_4 white hide"></div>
        <footer class="foot_tab fixed_bottom mx_green font_16"></footer>
    </div>
    <div class="toast"></div>
    <!-- toast模版 -->
    <script type="text/template" charset="utf-8" id='toast_template'>
        <i class="iconfont icon-toast{{=it.icon}}"></i>
        <div class="toast_text">{{=it.text}}</div>
    </script>
    <script type="text/template" charset="utf-8" id='swipe_template'></script>
    <script type="text/template" charset="utf-8" id='nav_template'></script>
    <script type="text/template" charset="utf-8" id='house_template'>
        {{for(var i=0;i<it.length;i++){}}
        <div class="margin_b_10 relative" onclick="location.href='{{=it[i].url}}'">
            <img src="{{=it[i].img}}" alt="">
            <div class="house_text h_justify bg_dark">
                <span>{{=it[i].address}}</span>
                <span class="warning">{{=it[i].price}}</span>
            </div>
        </div>
        {{}}}
    </script>
    <script>
        // 页面初始化
            var evalhouse = doT.template($("#house_template").text());
            loadsearchbar(function(){
                $(".header_usercenter").show().next().hide()
            });
            var banner = <{$slids}>;
            loadswipe(banner);
            var navs = <{$address}>;
            loadsidenav(navs);
            var farmhouse = <{$houses}>;
            loaddata(".farmhouse",evalhouse,farmhouse);
            loadfootbar();
        // 搜索
            var evalToast = doT.template($("#toast_template").text());
            function search(obj){
                var keywords = $(obj).next().val();
                if(keywords){
                    // $.post("",{keywords:keywords},function(res){console.log(res)
                    //     toast("attention",res.msg)
                    // },"json")
                }else{
                    toast("attention","请输入搜索关键词",function(){
                        $(obj).next().focus()
                    });
                }
            }
        // 下拉加载更多
            var pindex = 1;
            var pullRefresh = new mobileRefresh({
                container: document.querySelector('.refresh_content'),
                triggerDistance: 100,
                type:"up"
            },function(){
                $.post("/farmerhouse/site/load-more",{pindex:++pindex,_csrf:'<{$app->request->csrfToken}>'},function(res){
                    $(".pros").append(evalhouse(res));
                    pullRefresh.cancelLoading();
                },"json")
            })
    </script>


